<template>
    <div class="charts">
        <!-- 面包屑 -->
        <el-bread></el-bread>
        <!-- 添加按钮 -->
        <el-button @click="getDialog" type="primary" plain>添加</el-button>
        <!-- 表格 -->
        <v-list @edit="edit"></v-list>
        <!-- dialog弹框 -->
        <v-dialog ref="diaLogs" @cancel="cancel" :isShow="isShow" :isAdd="isAdd"></v-dialog>
    </div>
</template>
<script>
import vList from "./list.vue"
import vDialog from "./dialog.vue"
export default {
    data() {
        return {
            isShow: false,
            isAdd: true
        }
    },
    components: { vList, vDialog },
    mounted() {

    },
    methods: {
        getDialog() {
            //显示dialog
            this.isShow = true
            //是一个添加
            this.isAdd = true
        },
        //dialog取消按钮
        cancel(){
            this.isShow = false
        },
        //编辑
        edit(id){
            //显示dialog
            this.isShow = true
            //是一个编辑
            this.isAdd = false
            //dialog弹框
            this.$refs.diaLogs.lookup(id)
        }
    }
}
</script>
<style scoped></style>
